<?php
require('global.php');
require('comon/subpage.class.php'); 
$author = htmlspecialchars($_POST['author']);
$email = htmlspecialchars($_POST['email']);
$content = htmlspecialchars($_POST['content']);
if($author&&$email&&$content){
	$db->insert('p_guestbook',array('author'=>$author,'email'=>$email,'content'=>$content));
	
}
/*下面是翻页*/
$result_total = $db->query('select id from p_guestbook');
//总条目数
$rows = $db->fetch_array_all();
$total = count($rows);
//每页显示的条数
$page_size=5;
//每次显示的页数
$sub_pages=10;
//得到当前是第几页
$pageCurrent=$db->cleanOnlyNum($_GET["p"]);
$subPages=new SubPages($page_size,$total,$pageCurrent,$sub_pages,"guestbook.php?p=",2);
echo $subPages->showBar();
?>